package cn.skyclass.controls
{
	import mx.controls.DateField;
	
	/**
	 * 可以切换成纯显示状态(不可编辑)的日期控件
	 * @author fl
	 */
	[Bindable]
	public class DispalyDateField extends DateField
	{
		public function DispalyDateField()
		{
			setStyle("disabledColor", "#000000");
		}

		override public function get enabled():Boolean{
			return super.enabled;
		}
		override public function set enabled(value:Boolean):void{
			super.enabled = value;
			
			if(textInput){
				var style:String = value ? "inset" : "none";
				textInput.setStyle("borderStyle", style);
				
				// set backgroundAlpha to 0 always
				textInput.setStyle("backgroundAlpha", 0);
			}
		}
	}
}